﻿@model IEnumerable<iDMS.Models.DesignChange>
@using MvcHtmlHelpers;
@{
    ViewBag.Title = "Index";
}
<h3>
    Design Changes - <span class="accent">Index</span>
</h3>
<script type="text/javascript">
    $(function () {
        $("a.action").button();

        $('#email').hover(
					function () { $(this).addClass('ui-state-hover'); },
					function () { $(this).removeClass('ui-state-hover'); }
				);

    });

    
</script>
<fieldset>
    <legend>Search for Design Changes:</legend>
    @using (Html.BeginForm("Index", "DesignChange", FormMethod.Get))
    {                           
        <span class="display-label">Title or Identifier:</span> @Html.TextBox("search", null, new { @class = "searchTextBox" });
        <input type="submit" value="Search" />
    }
</fieldset>
<div id="list">
    <table>
        <tr>
            <th>
            </th>
            <th>
                Identifier
            </th>
            <th>
                Title
            </th>
            <th>
                Reason
            </th>
            <th>
                Change Builder
            </th>
            <th>
                Created
            </th>
            <th>
                Planned Release
            </th>
            <th>
                Phase
            </th>
            <th>
            </th>
        </tr>
        @foreach (var item in Model)
        {
            <tr>
                <td>
                    @Html.ActionLink("Details", "Details", new { id = item.DesignChangeID }, new { @class = "action" })
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Identifier)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Title)
                </td>
                <td title="@item.DesignChangeReason.Name">
                    @Html.DisplayFor(modelItem => item.DesignChangeReason.ShortName)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Employee.FullName)
                    @Html.EmployeeDetailsActionLink(item.Employee)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.CreateDate)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.PlannedReleaseDate)
                </td>
                <td title="@item.DesignChangePhase.Name">
                    @Html.DisplayFor(modelItem => item.DesignChangePhase.ShortName)
                </td>
            </tr>
        }
    </table>
</div>
<p>
    @Html.ActionLink("Create New", "Create", null, new { @id = "CreateLink" })
</p>
@Html.Partial("_AjaxDialog")
